<template>
    <div id="poster">
        <i class="close cubeic-close" @click="$emit('close')"></i>
        <div class="poster">
            <h2>扫一扫添加好友</h2>
            <h2>长按可保存图片哦~</h2>
            <img :src="src" />
        </div>
    </div>
</template>

<script>
    export default {
        name:"poster",
        data(){
            return {
                src:"",  //海报url
            };
        },
        props:{
            activityId:String
        },
        created(){
            this.get();
        },
        methods:{
            //获取生成海报
            get(){
                this.$request("share/findPoster",{
                    activity_id:this.activityId,
                    uid:this.$sysinfo.uid
                })
                    .then((res)=>{
                        if(res.data.status == "success"){
                            this.src = res.data.data+"?time="+new Date().getTime();
                        }
                    });
            }
        }
    };
</script>

<style lang="less" scoped src="./poster.less"></style>
